import { FormRules } from 'element-plus'

export const FormValidateRules: FormRules = {
  position: [
    {
      validator: (_, value, callback) => {
        if (CommonUtil.isNone(value.x)) callback(new Error('请输入节点 X 坐标'))
        if (CommonUtil.isNone(value.y)) callback(new Error('请输入节点 Y 坐标'))
        callback()
      },
      trigger: 'blur'
    }
  ],
  ['data.label']: [{ required: true, message: '请输入节点名称', trigger: 'blur' }],
  ['data.cmd']: [{ required: true, message: '请输入节点要执行的命令', trigger: 'blur' }]
}
